﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AcademicPlanner.Data
{
	/// <summary>
	/// Entity is the base class for all data entities of the
	/// AcademicPlanner application. An <c>Entity</c> represents the
	/// data aspect of a domain layer's <c>Model</c>.
	/// </summary>
	/// <version>1.0</version>
	/// <since>1.0</since>
    public abstract class Entity
    {
		/// <summary>
		/// Gets the <c>DataSourceAccessSupervisor</c> of the data layer of the application.
		/// </summary>
		/// <version>1.0</version>
		/// <since>1.0</since>
		protected DataSourceAccessSupervisor DSAS { get { return DataSourceAccessSupervisor.GetInstance(); } }

		/// <summary>
		/// Gets or sets this <c>Entity</c>'s identifier.
		/// </summary>
		/// <version>1.0</version>
		/// <since>1.0</since>
		public virtual int Id { get; set; }

		/// <summary>
		/// Gets or sets this <c>Entity</c>'s date of creation.
		/// </summary>
		/// <version>1.0</version>
		/// <since>1.0</since>
		public virtual DateTime Date_Added { get; set; }

		/// <summary>
		/// Gets or sets whether this <c>Entity</c> is deleted or not.
		/// </summary>
		/// <version>1.0</version>
		/// <since>1.0</since>
		public virtual bool Trashed { get; set; }


		/// <summary>
		/// Sets the default values of this <c>Entity</c>'s properties.
		/// <c>Date_Added</c> is set to <c>DateTime.Now</c> and
		/// <c>Trashed</c> is set to <c>false</c>.
		/// </summary>
		/// <version>1.0</version>
		/// <since>1.0</since>
		public virtual void SetDefaults()
		{
			Date_Added = DateTime.Now;
			Trashed = false;
		}
    }
}
